<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputStylesheet name="css/jsfcrud.css"/>
    </h:head>

    <h:body style="background: #3a4f54">
        <p:layout fullPage="true" style="background: black; border: 0px;">  

            <p:layoutUnit position="north" size="500"  resizable="true" closable="true"  collapsible="true" maxSize="238" styleClass="image" >  
                <h:form>  
                    <p:menubar style=" appearance: pop-up-menu; height:20px; border: solid 0px;  top: auto; font-size: 12px;  bottom: auto; " >
                        <p:menuitem rendered="#{personController.logado}" value="Bem Vindo, #{personController.userCurrent.name}" style=" height: 10px" action="#{clientController.prepareEdit()}"/>
                      
                        <p:menuitem rendered="#{!personController.logado}" value="Cadastre-se"  action="/paginas/client/Create" style=" height: 10px"/>
                        <p:menuitem rendered="#{personController.logado}" action="#{personController.logOut()}" value="LogOut" />
                        <p:menuitem rendered="#{!personController.logado}" value="LogIn"  outcome="/login" style="height: 10px" />
                        <p:menuitem rendered="#{personController.logado}" value="Meu Carrinho (#{orderesController.qtd})" outcome="#{orderesController.CarrinhoLista()}" />
                        

                    </p:menubar>
                    <p:graphicImage alt="LOGO" value="/logo.jpg" width="100%" height="195" />

                </h:form>  

            </p:layoutUnit>  


            <p:layoutUnit position="center" style="border: solid 0px;">  
                <h:form >  

                    <table align="center" width="1528px" border="-1" height="200px"  style="border: solid 0px;">
                        <tr>
                            <td align="center"  style="border: solid 0px;">


                                <table align="left" width="200px" xml:lang="left" border="0" style="border: solid 0px;">
                                    <tr>
                                        <td align="left" style="border: none;" >
                                            <p:menu >
                                                <p:submenu label="Atalhos" />
                                                <p:menuitem value="Home" action="/home" />
                                                <p:menuitem value="Administração" action="#{personController.verificaPaginaAdm()}"/>
                                                <p:menuitem value="Clientes" action="/paginas/client/List"  rendered="#{personController.ehAdmin()}"/>
                                                <p:menuitem value="Pedidos" action="/paginas/orderes/List"  rendered="#{personController.ehAdmin()}" />
                                                <p:menuitem rendered="#{personController.logado}" value="Fornecedor" action="/paginas/supply/List" />
                                                <p:menuitem value="Entrar" rendered="#{!personController.logado}" outcome="/login" />
                                                <p:menuitem action="/home" value="Produtos" />
                                                <p:menuitem action="/paginas/supply/Create" value="Novo Fornecedor" rendered="#{personController.ehAdmin()}"  />
                                                <p:menuitem action="/paginas/hardware/Create" value="Novo Hardware" rendered="#{personController.ehAdmin()}" />
                                                <p:menuitem action="/paginas/software/Create" value="Novo Software" rendered="#{personController.ehAdmin()}"/>
                                                
                                            </p:menu>

                                        </td>
                                    </tr>

                                </table>


                                <table align="center" width="1200px" xml:lang="center" border="0" height="200px" style="border: solid 0px;">
                                    <tr>
                                        <td align="center" style="border: none;">
                                            <h:form>
                                            <p>
                                                <p:growl autoUpdate="true" sticky="true" showDetail="true" />
                                                <p:panel>
                                                <ui:insert name="body">Default Body</ui:insert>
                                                </p:panel>
                                            </p>
                                            </h:form>   
                                        </td>
                                    </tr>

                                </table>


                            </td>
                        </tr>

                    </table>

                </h:form>  
            </p:layoutUnit>  

        </p:layout>  



    </h:body>

</html>
